package com.gitee.wsl.doc.prosemirror.model

import com.gitee.wsl.doc.prosemirror.model.mark.MarkSpec
import com.gitee.wsl.doc.prosemirror.model.node.NodeSpec

// An object describing a schema, as passed to the [`Schema`](#model.Schema) constructor.
data class SchemaSpec(
    // The node types in this schema. Maps names to [`NodeSpec`](#model.NodeSpec) objects that
    // describe the node type associated with that name. Their order is significant—it determines
    // which [parse rules](#model.NodeSpec.parseDOM) take precedence by default, and which nodes
    // come first in a given [group](#model.NodeSpec.group).
    val nodes: Map<String, NodeSpec> = emptyMap(),

    // The mark types that exist in this schema. The order in which they are provided determines the
    // order in which [mark sets](#model.Mark.addToSet) are sorted and in which
    // [parse rules](#model.MarkSpec.parseDOM) are tried.
    val marks: Map<String, MarkSpec> = emptyMap(),

    // The name of the default top-level node for the schema. Defaults to `"doc"`.
    val topNode: String? = null,

    // The name of the node for the schema to fall back whenever we encounter unknown node type.
    // The node will have original name saved into originalNodeName field if creator returned UnsupportedNode type
    val unsupportedNode: String = "unsupportedBlock",

    // The name of the inline node for the schema to fall back whenever we encounter unknown node type.
    // The node will have original name saved into originalNodeName field if creator returned UnsupportedNode type
    val unsupportedInlineNode: String = "unsupportedInline",

    // The name of the mark for the schema to fall back whenever we encounter unknown mark type.
    // The mark will have original name saved into originalMarkName field if creator returned UnsupportedMark type
    val unsupportedMark: String = "unsupportedMark"
)